﻿using SimpleServiceBus.Endpoint;

namespace SimpleServiceBus.Bus.MessageManagement.Callbacks
{
    public interface ICorrelatedCallbackManager : IEndpointService
    {
        ICallback Register(string correlationId);
        /// <summary>
        /// Notify waiters if a response correlates to a request
        /// </summary>
        /// <param name="correlationId"></param>
        /// <param name="message"></param>
        /// <returns>true if a waiter has been notified, in which case processing should stop</returns>
        bool Notify(string correlationId, object message);
        void Unregister(string correlationId);
    }
}